<?php
/**
 * Num记录数组相关的方法
 * 数组相关的类库 封装
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/20
 * Time: 9:49
 */
declare(strict_types=1);
namespace app\common\lib;
class Num{
    /**返回随机验证码6位或者4位
     * @param int $len
     * @return int
     */
    public static function getCode(int $len=4) :int {
        $code = rand(1000,9999);
        if($len = 6){
            $code = rand(100000,999999);
        }
        return $code;
    }
}